Chris Pollett > Old Classes >
CS152

( Print View )

Student Corner:
  [Grades Sec1]

  [Submit Sec1]

  [Class Sign Up Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HWs and Quizzes:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Mid]  [Final]

                           












CS152 Spring 2009Practice Final

To study for the final I would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes at least three times. Second and third time try to see how much you can remember from the first time. (3) Go over what you did on the HW sets. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) If you want to study in groups, at this point you are ready to quiz each other. The practice midterm is below. Here are some facts about the actual final: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) The final is ten problems and is comprehensive. There will be four problems containing material from before the midterm; six problems containing material after the midterm. (e) One problem (less typos) on the actual test will be from the practice final; one problem (less typos) will be from the practice midterm.

  1. When C is compiled to assembly where do static variables in functions get stored?
  2. Write a small Objective-C class and show the syntax needed to instantiate an instance of it.
  3. Briefly define the following terms: (a) referential transparency, (b) value semantics, (c) higher-order function.
  4. Write a scheme function to compute the sum of the squares of the numbers from 1 to n. Define tail recursion and re-write your program tail recursively (if it is not already tail recursive).
  5. Give an example of how to do message passing in (a) Scheme, (b) ML.
  6. Give an example of how to declare the following kinds of types in ML: (a) a simple but not predefined type. (b) a cartesian product of two copies of the type that consists of functions from ints to ints. (c) A variant record type. (d) a recursive type.
  7. Explain the difference between name and structural equivalence.
  8. What is lazy evaluation? Explain how it can be simulated in ML.
  9. What are the following parts of a stack frame for: (a) the environment pointer. (b) the offset. (c) control link?
  10. In the context of Prolog, what is a cut and what is it good for?